package com.giaothong.utils;

import com.google.android.maps.GeoPoint;

public class CalculatorUlits {

	/**
	 * get Int lat or lng from String
	 * 
	 * @param str
	 * @return
	 */
	public static int getIntLatLgnFromString(String str) {
		return (int) (Double.parseDouble(str) * 1000000);
	}

	/**
	 * get url routing
	 * 
	 * @param startLocation
	 * @param endLocation
	 * @param method
	 * @return
	 */
	public static String getUrlRoutingMapView(GeoPoint startLocation, GeoPoint endLocation, String method) {
		return "http://maps.googleapis.com/maps/api/directions/json?origin=" + (double) (startLocation.getLatitudeE6()) / 1000000 + "," + (double) startLocation.getLongitudeE6() / 1000000 + "&destination=" + (double) endLocation.getLatitudeE6() / 1000000 + "," + (double) endLocation.getLongitudeE6() / 1000000 + "&sensor=false&mode=" + method;
	}
}
